﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ReporteExamenes.aspx.cs"
    Inherits="Ent.Inscripcion.Presentacion.Administracion.Reportes.ReporteExamenes" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>Reportes Examenes</title>
    <ext:ResourcePlaceHolder ID="ResourcePlaceHolder1" runat="server" Mode="Script" />
    <script type="text/javascript" src="../../Resources/Js/EntInscripcion.js"></script>
</head>
<body>
    <form id="form1" runat="server">
    <ext:ResourceManager ID="ResourceManager1" runat="server" Locale="es" />
    <script type="text/javascript" language="javascript">
    var saveData = function () {
            <%= GridData.ClientID%>.setValue(Ext.encode(<%= gdpDatosRegistradosTutorias.ClientID%>.getRowsValues(false)));
        }
    </script>
    <ext:Hidden ID="GridData" runat="server" />
    <ext:Panel BodyStyle="background-color:transparent;" Border="false" Title="Gráfico Estadístico"
        runat="server" ButtonAlign="Center" Collapsible="true" Padding="5">
        <Items>
            <ext:Panel BodyStyle="background-color:transparent;" Border="false" 
                runat="server" ButtonAlign="Center" Padding="5">
                <Items>
                    <ext:Panel BodyStyle="background-color:transparent;" Border="false" runat="server"
                        ButtonAlign="Center" Layout="Column">
                        <Items>
                            <ext:Panel runat="server" BodyStyle="background-color:transparent;" Border="false"
                                Layout="Form" ColumnWidth="0.65">
                                <Content>
                                    <center>
                                        <asp:Chart ID="Chart1" runat="server" Width="600px" Height="350px" Palette="BrightPastel"
                                            BorderColor="181, 64, 1" BorderlineDashStyle="Solid" BackGradientStyle="TopBottom"
                                            BorderWidth="1" BackColor="#F3DFC1" ImageType="Png" ImageLocation="~\TempImages\ChartPic_#SEQ(300,3)">
                                            <Titles>
                                                <asp:Title ShadowColor="32, 0, 0, 0" Font="Trebuchet MS, 14.25pt, style=Bold" ShadowOffset="3"
                                                    Text="Reporte de Examenes" Alignment="TopLeft" ForeColor="26, 59, 105">
                                                </asp:Title>
                                            </Titles>
                                            <Legends>
                                                <asp:Legend Enabled="true" IsTextAutoFit="False" Name="Default" BackColor="Transparent"
                                                    Font="Trebuchet MS, 8.25pt, style=Bold">
                                                </asp:Legend>
                                            </Legends>
                                            <BorderSkin SkinStyle="Emboss"></BorderSkin>
                                            <Series>
                                                <asp:Series ChartArea="ChartArea1" Name="Series 1" BorderColor="180, 26, 59, 105"
                                                    Color="224, 64, 10">
                                                </asp:Series>
                                            </Series>
                                            <ChartAreas>
                                                <asp:ChartArea Name="ChartArea1" BorderColor="64, 64, 64, 64" BorderDashStyle="Solid"
                                                    BackSecondaryColor="White" BackColor="OldLace" ShadowColor="Transparent" BackGradientStyle="TopBottom">
                                                    <Area3DStyle Rotation="10" Perspective="10" Inclination="15" IsRightAngleAxes="False"
                                                        WallWidth="0" IsClustered="False"></Area3DStyle>
                                                    <AxisY LineColor="64, 64, 64, 64" IsLabelAutoFit="False">
                                                        <LabelStyle Font="Trebuchet MS, 8.25pt, style=Bold" />
                                                        <MajorGrid LineColor="64, 64, 64, 64" />
                                                    </AxisY>
                                                    <AxisX LineColor="64, 64, 64, 64" IsLabelAutoFit="False">
                                                        <LabelStyle Font="Trebuchet MS, 8.25pt, style=Bold" IsStaggered="True" />
                                                        <MajorGrid LineColor="64, 64, 64, 64" />
                                                    </AxisX>
                                                </asp:ChartArea>
                                            </ChartAreas>
                                        </asp:Chart>
                                    </center>
                                </Content>
                            </ext:Panel>
                            <ext:Panel ID="Panel2" BodyStyle="background-color:transparent;" runat="server" Height="100"
                                Border="false" LabelWidth="70" ButtonAlign="Center" Layout="Form" ColumnWidth="0.35">
                                <Items>
                                    <ext:ComboBox ID="cbxVariable" runat="server" Editable="false" ValueField="Codigo"
                                        DisplayField="Nombre" AllowBlank="false" FieldLabel="Variable" AnchorHorizontal="95%"
                                        EmptyText="Seleccione..">
                                        <Store>
                                            <ext:Store runat="server" ID="stoVariables">
                                                <Reader>
                                                    <ext:JsonReader IDProperty="Id">
                                                        <Fields>
                                                            <ext:RecordField Name="Id" />
                                                            <ext:RecordField Name="Codigo" />
                                                            <ext:RecordField Name="Nombre" />
                                                            <ext:RecordField Name="Descripcion" />
                                                        </Fields>
                                                    </ext:JsonReader>
                                                </Reader>
                                            </ext:Store>
                                        </Store>
                                        <ToolTips>
                                            <ext:ToolTip ID="ToolTip1" runat="server" Title="Variable del reporte">
                                            </ext:ToolTip>
                                        </ToolTips>
                                        <DirectEvents>
                                            <Select OnEvent="cbxVariable_Select">
                                                <ExtraParams>
                                                    <ext:Parameter Name="Nombre" Mode="Raw" Value="record.get('Nombre')">
                                                    </ext:Parameter>
                                                    <ext:Parameter Name="Variable" Mode="Raw" Value="record.get('Codigo')">
                                                    </ext:Parameter>
                                                </ExtraParams>
                                            </Select>
                                        </DirectEvents>
                                    </ext:ComboBox>
                                </Items>
                                <Buttons>
                                    <ext:Button ID="btnVerReporte" runat="server" Text="Ver Reporte" OnClick="btnVerReporte_Click"
                                        AutoPostBack="true">
                                    </ext:Button>
                                </Buttons>
                            </ext:Panel>
                        </Items>
                    </ext:Panel>
                </Items>
            </ext:Panel>
        </Items>
    </ext:Panel>
    <ext:GridPanel ID="gdpDatosRegistradosTutorias" runat="server" Title="Datos" Height="500"
        AutoExpandColumn="Carrera">
        <Store>
            <ext:Store runat="server" ID="stoDatosReporteEstadistica" GroupField="Valor">
                <Reader>
                    <ext:JsonReader IDProperty="Id">
                        <Fields>
                            <ext:RecordField Name="Id" />
                            <ext:RecordField Name="Valor" />
                            <ext:RecordField Name="Nombres" />
                            <ext:RecordField Name="Identificacion" />
                            <ext:RecordField Name="Carrera" />
                            <ext:RecordField Name="Periodo" />
                            <ext:RecordField Name="Nivel" />
                            <ext:RecordField Name="Dia" />
                            <ext:RecordField Name="Fecha" Type="Date" />
                            <ext:RecordField Name="HoraInicio" Type="Date" />
                            <ext:RecordField Name="HoraFin" Type="Date" />
                        </Fields>
                    </ext:JsonReader>
                </Reader>
            </ext:Store>
        </Store>
        <TopBar>
            <ext:Toolbar ID="Toolbar1" runat="server" AutoWidth="true">
                <Items>
                    <ext:Button ID="Button3" runat="server" Text="Exportar a Excel" AutoPostBack="true"
                        OnClick="ToExcel" Icon="PageExcel">
                        <Listeners>
                            <Click Fn="saveData" />
                        </Listeners>
                    </ext:Button>
                </Items>
            </ext:Toolbar>
        </TopBar>
        <ColumnModel ID="ColumnModel1" runat="server">
            <Columns>
                <ext:Column ColumnID="Valor" Header="Variable" DataIndex="Valor" Width="80" Hidden="true">
                </ext:Column>
                <ext:GroupingSummaryColumn ColumnID="Nombre" Width="200" Header="Nombres" DataIndex="Nombres"
                    SummaryType="None">
                </ext:GroupingSummaryColumn>
                <ext:GroupingSummaryColumn Header="Identificación" DataIndex="Identificacion" SummaryType="None"
                    Width="90">
                </ext:GroupingSummaryColumn>
                <ext:GroupingSummaryColumn ColumnID="Periodo" Width="200" Header="Periodo" DataIndex="Periodo"
                    SummaryType="None">
                </ext:GroupingSummaryColumn>
                <ext:GroupingSummaryColumn Header="Nivel" DataIndex="Nivel" SummaryType="None" Width="90">
                </ext:GroupingSummaryColumn>
                <ext:GroupingSummaryColumn Header="Dia" DataIndex="Dia" SummaryType="None" Width="90">
                </ext:GroupingSummaryColumn>
                <ext:GroupingSummaryColumn ColumnID="Fecha" Width="70" Header="Fecha" Sortable="true"
                    DataIndex="Fecha" SummaryType="Max">
                    <Renderer Format="Date" FormatArgs="'d/M/Y'" />
                </ext:GroupingSummaryColumn>
                <ext:GroupingSummaryColumn ColumnID="HoraInicio" Width="60" Header="Hora Inicio"
                    Sortable="true" DataIndex="HoraInicio" SummaryType="Max">
                    <Renderer Format="Date" FormatArgs="'H:i'" />
                </ext:GroupingSummaryColumn>
                <ext:GroupingSummaryColumn ColumnID="Carrera" Header="Carrera" DataIndex="Carrera"
                    SummaryType="None" Width="200">
                </ext:GroupingSummaryColumn>
            </Columns>
        </ColumnModel>
        <View>
            <ext:GroupingView ID="GroupingView1" runat="server" />
        </View>
        <Plugins>
            <ext:GroupingSummary ID="GroupingSummary1" runat="server" />
        </Plugins>
    </ext:GridPanel>
    </form>
</body>
</html>
